package cn.net.chenbao.medical.xutils;

import com.alibaba.fastjson.JSONObject;

import org.xutils.http.RequestParams;

import java.util.Map;

public class ParamsUtils {
	/**
	 * post传json
	 * 
	 * @param jsonObject
	 * @param url
	 * @return
	 */
	public static RequestParams getPostJsonParams(JSONObject jsonObject,
                                                  String url) {
		RequestParams params = new RequestParams(url);
		params.setAsJsonContent(true);
		params.setBodyContent(jsonObject.toString());
		return params;
	}

	/**
	 * get
	 *
	 * @param url
	 * @return
	 */
	public static RequestParams getParams(String url) {
		RequestParams params = new RequestParams(url);
		return params;
	}
	/** 只带session参数的请求 */
//	public static RequestParams getSessionParams(String api) {
//		RequestParams params = new RequestParams(api);
//		params.addQueryStringParameter(Consts.KEY_SESSIONID, BeautyApplication
//				.getInstance().getSessionId());
//		return params;
//	}
}
